class Employee
	{

	private int id;
	private String name ;
	private int dept;
	
	Employee()
		{
		}
		
	Employee(int i, String n, int d)
		{
		id = i;
		name=n;
		dept=d;
		}
		
	public void getEmployee()
		{
			System.out.println("Employee Details: " +id +" "+name +" "+ dept);
		}
		
	
	int[] sortID(Employee[] e)
		{
		int[] tempId = new int[e.length];
		for(int i=0;i<e.length;i++)
			tempId[i] = e[i].id;
		for(int j=0; j<e.length-1; j++)
			{
			for(int i=0; i<e.length-1-j; i++)
				{
				if(tempId[i]>tempId[i+1])
					{
					int t=tempId[i];
					tempId[i]= tempId[i+1];
					tempId[i+1] = t;
					}
				}
			}
		return tempId;
		}
	
	public static void main(String[] args)
		{
		 	
		Employee[] emp = new Employee[3];
		emp[0] = new Employee(1986, "Niranjan",1);
		emp[1] = new Employee(2024, "Biplab", 2);
		emp[2] = new Employee(1456, "Deepak", 3);
		
		emp[0].getEmployee();
		emp[1].getEmployee();
		emp[2].getEmployee();
		
		
		Employee e = new Employee();
		
		int[] sortedId = e.sortID(emp);
		
		Employee[] SortedEmployee = new Employee[3];
		for(int i=0;i<sortedId.length;i++)
			{
			for(int j=0; j<emp.length; j++)
				{
				if(sortedId[i] == emp[j].id)
				SortedEmployee[i] = emp[j];
				}
			}
		SortedEmployee[0].getEmployee();
		SortedEmployee[1].getEmployee();
		SortedEmployee[2].getEmployee();
		}
	}